# -*- coding: utf-8 -*-
#
# File: ARFilePreview/interfaces.py
#
# Copyright (c) 2007 atReal
#
# GNU General Public License (GPL)
#
# 
#

"""
$Id$
"""

__author__ = """Jean-Nicolas Bès <contact@atreal.net>"""
__docformat__ = 'plaintext'
__licence__ = 'GPL'


from zope.interface import Interface
from zope import interface
from zope.component.interfaces import ObjectEvent, IObjectEvent

class IClickEvent(IObjectEvent):
    """ Event gets fired when the object was viewed """
    
class ClickEvent(ObjectEvent):
    interface.implements(IClickEvent)
    

class IPreviewAware( Interface ):
    """ marker interface """
class ICountAware(Interface):
    """ the marke interface of that object  can be countted """
class ITrackDownloadAware( Interface ):
    """ marker interface """   
    


class ITrackDownload(Interface):
    """track relative download info"""
    def download_url():
        """generate actual download url"""
    def updateDldCount():
        """update download numbers"""
    def getDldCount():
        """get current downloaded numbers"""
    def setDldCount():
        """set current downloaded numbers"""        
class ICountable(Interface):
    """ the functions and attributes of the object was countted """
    def updateCount():
        """ update the count number"""
        
    def setCount():
        """ set count"""
    def getCount():
        """get count number"""   
class IPreviewable( Interface ):
    
    def hasPreview( ):
        """
        Has the preview
        """
    
    def setPreview( preview):
        """
        Sets the preview
        """
    
    def getPreview( ):
        """
        Get the preview
        """
   
class IPreviewProvider( Interface ):
    
    def hasPreview( ):
        """
        Has the preview
        """    
    def getPreview( ):
        """
        Get the preview
        """        
    def updatePreview( ):
        """
        update the preview by retransforming original file and store it
        """    
    def updateAllPreviews( ):
        """
        update all the previews reachable from the catalog
        """
class ICountProvider(Interface):
    def updateCount():
        """ update the count number"""
        
    def setCount():
        """ set count"""
    def getCount():
        """get count number""" 
    
